Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed and deprecated payment.isRefundable #385

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

janpaepke
Copy link
Collaborator

The isRefundable helper on a payment actually never returned false, because the strict null comparison is incorrect.
If amountRemaining is not provided (as it is for non-refundable payments), it is undefined rather than null.

This is also reflected in canBeRefunded, which is correct and should be used instead.
To not make this a breaking change, I fixed the behaviour and deprecated the method.

@janpaepke janpaepke added this to the 4.2.0 milestone Sep 27, 2024
@janpaepke janpaepke requested a review from edorivai September 27, 2024 11:33
@janpaepke janpaepke added the bug Unexpected behaviour. label Sep 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Unexpected behaviour.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant